#include<iostream>
#include<vector>
#include<string>
using namespace std;
class Solution {
public:
    vector<int> numberOfLines(vector<int>& widths, string s) {
        int w = 0,len=0;
        vector<int> ans(2,1);   //默认填充1
        for(char &c:s) {
            w = widths[c-'a'];
            if(len+w > 100){
                len=0;
                ans[0]++;
            }
            len+=w;
        }
        ans[1]=len;
        return ans;
    }
};
int main(int argc, char** argv){
    Solution *s = new Solution();
    vector<int> widths{4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10};
    vector<int> result;
    result = s->numberOfLines(widths,"bbbcccdddaaa");
    cout << "[" << result[0] << "," << result[1]<<"]" << endl;
    return 0;
}